import datetime
import time

import pickledb
import json
'''
API 地址
https://pythonhosted.org/pickleDB/commands.html

'''
db = pickledb.load('ws.db', True)

jsonObj = json.loads('{"1":"213"}')
date = datetime.datetime.now().strftime('%Y-%m-%d')
key = 'ws%s' % date
list_=db.lcreate(key) # 创建list
db.ladd(key, jsonObj)
db.ladd(key, {"2":None})
db.ladd(key, {"3":"asd"})
# db.dump()
print('删除前 :',db.lgetall(key))  # 获取所有列表
#
print(db.lpop(key,0))  # 取出并删除一个值
print(db.lpop(key,0))  # 取出并删除一个值
print(db.lpop(key,0))  # 取出并删除一个值
print('all:',db.lgetall(key))
print(db.lexists())
